<template>
    <div class="search">
        <Card>
                <Row type="flex" justify="space-between" class="code-row-bg">
                    <Form :label-width="50">
                        <div class="tree-bar">
                            <Tree ref="tree" :data="areasData" :load-data="loadData" @on-check-change="changeSelect" @on-select-change="selectTree"></Tree>
                        </div>
                    </Form>
                    <Col :span="span">
                        <Row>
                            <Form ref="useInfoForm" :model="useInfoForm" inline :label-width="50" class="search-form">
                                        <Form-item label="登录名" prop="username">
                                            <Input type="text" v-model="useInfoForm.username" clearable placeholder="请输入"
                                                   style="width: 200px"/>
                                        </Form-item>

                                        <Form-item label="用户名" prop="userRealName">
                                            <Input type="text" v-model="useInfoForm.userRealName" clearable placeholder="请输入"
                                                   style="width: 200px"/>
                                        </Form-item>

                                        <Form-item label="角色" prop="roleId">
                                            <Select v-model="useInfoForm.roleId" filterable remote  clearable
                                                    :placeholder="mainRoleName" style="width: 200px;" @on-change="selectPord"
                                                    :label-in-value="true"
                                                    @on-open-change="queryRoleSelectList($event)">
                                                <Option :value="item.id" v-for="(item,index) in roleList" :key="index">{{item.roleName}}</Option>
                                                <Page v-show="roleList.length>0" :page-size="pageData.pageSize" :total="pageData.total"
                                                      @on-change="changeBasePage" style="text-align: center;" simple />
                                            </Select>
                                        </Form-item>

                                        <Form-item label="状态" prop="lockFlag">
                                            <Select v-model="useInfoForm.lockFlag" placeholder="请选择" clearable style="width: 200px">
                                                <Option value="0">启用</Option>
                                                <Option value="9">停用</Option>
                                            </Select>
                                        </Form-item>

                                <Row  style="text-align: center">
                                    <Form-item style="margin-left:-60px; text-align: center" class="br">
                                        <Button @click="handleSearch" type="primary" icon="ios-search">查询</Button>
                                        <Button @click="handleReset" icon="md-redo">重置</Button>
                                    </Form-item>
                                </Row>
                            </Form>
                        </Row>

                            <Row class="operation">
                                
                                <Button type="primary" v-if="this.operationUser=='00'&&$store.getters.permissions['other_new_management']" @click="stopNewCar()" >停新车进件</Button>
                                <Button type="primary" v-if="this.operationUser=='00'&&$store.getters.permissions['other_new_management']" @click="startNewCar()" >启新车进件</Button>
                                <Button type="primary" v-if="this.operationUser=='00'&&$store.getters.permissions['other_old_management']" @click="stopOldCar()" >停二手车进件</Button>
                                <Button type="primary" v-if="this.operationUser=='00'&&$store.getters.permissions['other_old_management']" @click="startOldCar()" >启二手车进件</Button>
                                <Button type="primary" v-if="this.operationUser=='00'&&$store.getters.permissions['other_new_management']" @click="stopNewAccount()" >停新车账号</Button>
                                <Button type="primary" v-if="this.operationUser=='00'&&$store.getters.permissions['other_new_management']" @click="startNewAccount()" >启新车账号</Button>
                                <Button type="primary" v-if="this.operationUser=='00'&&$store.getters.permissions['other_old_management']" @click="stopOldAccount()" >停二手车账号</Button>
                                <Button type="primary" v-if="this.operationUser=='00'&&$store.getters.permissions['other_old_management']" @click="startOldAccount()" >启二手车账号</Button>
                                
                                <Button type="primary" v-if="this.operationUser=='01'&&$store.getters.permissions['own_new_management']" @click="stopNewCar()" >停新车进件</Button>
                                <Button type="primary" v-if="this.operationUser=='01'&&$store.getters.permissions['own_new_management']" @click="startNewCar()" >启新车进件</Button>
                                <Button type="primary" v-if="this.operationUser=='01'&&$store.getters.permissions['own_old_management']" @click="stopOldCar()" >停二手车进件</Button>
                                <Button type="primary" v-if="this.operationUser=='01'&&$store.getters.permissions['own_old_management']" @click="startOldCar()" >启二手车进件</Button>
                                <Button type="primary" v-if="this.operationUser=='01'&&$store.getters.permissions['own_new_management']" @click="stopNewAccount()" >停新车账号</Button>
                                <Button type="primary" v-if="this.operationUser=='01'&&$store.getters.permissions['own_new_management']" @click="startNewAccount()" >启新车账号</Button>
                                <Button type="primary" v-if="this.operationUser=='01'&&$store.getters.permissions['own_old_management']" @click="stopOldAccount()" >停二手车账号</Button>
                                <Button type="primary" v-if="this.operationUser=='01'&&$store.getters.permissions['own_old_management']" @click="startOldAccount()" >启二手车账号</Button>
                            </Row>
                            <Row>
                                <Alert show-icon>
                                已选择 <span class="select-count">{{selectCount}}</span> 项
                                <a class="select-clear" @click="clearSelectAll">清空</a>
                                </Alert>
                            </Row>
                            <Row>
                                <Table
                                    :loading="loading"
                                    border
                                    :columns="columns"
                                    :data="data"
                                    sortable="custom"
                                    @on-sort-change="changeSort"
                                    @on-selection-change="showSelect"
                                    ref="table"
                                    >
                                    <template slot-scope="{ row }" slot="newApplyPower">
                                        <div>
                                            <tag v-if="row.newApplyPower=='0'" color="success" size="default">正常</tag>
                                            <tag v-if="row.newApplyPower=='9'" color="warning" size="default">停用</tag>
                                        </div>
                                    </template>

                                    <template slot-scope="{ row }" slot="odlApplyPower">
                                        <div>
                                            <tag v-if="row.odlApplyPower=='0'" color="success" size="default">正常</tag>
                                            <tag v-if="row.odlApplyPower=='9'" color="warning" size="default">停用</tag>
                                        </div>
                                    </template>

                                    <template slot-scope="{ row }" slot="newAccountPower">
                                        <div>
                                            <tag v-if="row.newAccountPower=='0'" color="success" size="default">正常</tag>
                                            <tag v-if="row.newAccountPower=='9'" color="warning" size="default">停用</tag>
                                        </div>
                                    </template>

                                    <template slot-scope="{ row }" slot="oldAccountPower">
                                        <div>
                                            <tag v-if="row.oldAccountPower=='0'" color="success" size="default">正常</tag>
                                            <tag v-if="row.oldAccountPower=='9'" color="warning" size="default">停用</tag>
                                        </div>
                                    </template>
                                    <template slot-scope="{ row }" slot="lockFlag">
                                        <div>
                                            <tag v-if="row.lockFlag=='0'" color="success" size="default">启用</tag>
                                            <tag v-if="row.lockFlag=='9'" color="warning" size="default">禁用</tag>
                                        </div>
                                    </template>
                                    <template slot-scope="{ row, index }" slot="action">
                                        <Button style="margin-right:5px" type="primary" size="small" @click="resetPassword(row)">重置密码</Button>
                                        <Button style="margin-right:5px" type="primary" size="small" @click="senderUser(row)">同步归档</Button>
                                    </template>
                                </Table>
                            </Row>
                            <Row type="flex" justify="end" class="page">
                                <Page
                                    :current="useInfoForm.pageNumber"
                                    :total="total"
                                    :page-size="useInfoForm.pageSize"
                                    @on-change="changePage"
                                    @on-page-size-change="changePageSize"
                                    :page-size-opts="[10,20,50]"
                                    size="small"
                                    show-total
                                    show-elevator
                                    show-sizer
                                ></Page>
                            </Row>
                    </Col>
                </Row>
        </Card>
    </div>
</template>
<script>
    import {
        getDeptInfoByChannelId,
        getApplyUserInfo,
        getRoleList,
        stopApply,
        startApply,
        startUser,
        stopUser,
        resetPassWord,
        senderUser
    } from "_p/afs-channel/api/common/common.js"
    export default {
        name: "useInfoManage",
        components:{

        },
        data() {
            return {
                newCarRole:"",
                oldCarRole:"",
                loading: false,
                operationLoading: false,
                importLoading: false,
                loadingExport: true,
                selectCount: 0,
                selectList: [],
                expandLevel:0,
                span: 18,
                selectDate: null,
                modalType: 0,
                modalTitle: "",
                deptId:"",
                deptIdOne:"",
                mainRoleName: "请选择",
                roleList:[],
                selectParam: {},
                pageData: {
                    pageNumber: 1,
                    pageSize: 5,
                    total: 0
                },
                //树状图
                sysForm:{

                },
                //树状图rules
                useInfoFormValidate:{

                },
                //用户信息
                useInfoForm: {
                    pageNumber: 1,
                    pageSize: 10,
                    username:"",
                    userRealName:"",
                    lockFlag:"",
                    roleId:""
                },

                areasData: [
                ],

                columns: [
                    {
                        type: "selection",
                        minWidth: 60,
                        maxWidth:60,
                        align: "center",
                    },
                    {
                        title: "登录名",
                        key: "username",
                        minWidth: 150
                    },
                    {
                        title: "用户名",
                        key: "userRealName",
                        minWidth: 155
                    },
                    {
                        title: "证件号码",
                        key: "identityNumber",
                        minWidth: 155
                    },
                    {
                        title: "所属部门",
                        key: "departmentTitle",
                        minWidth: 150
                    },
                    {
                        title: "角色",
                        key: "roleName",
                        minWidth: 150,
                        ellipsis:true,
                        render: (h, params) => {
                            return h('div', [
                                h('span', {
                                    style: {
                                        display: 'inline-block',
                                        width: '100%',
                                        overflow: 'hidden',
                                        textOverflow: 'ellipsis',
                                        whiteSpace: 'nowrap'
                                    },
                                    domProps: {
                                        title: params.row.roleName
                                    }
                                }, params.row.roleName)
                            ])
                        }
                    },
                    {
                        title: "手机",
                        key: "phone",
                        minWidth: 150
                    },
                    {
                        title: "邮箱",
                        key: "userEmail",
                        minWidth: 150
                    },
                    {
                        title: "新车进件",
                        key: "newApplyPower",
                        minWidth: 150,
                        slot:"newApplyPower"
                    },
                    {
                        title: "二手车进件",
                        key: "odlApplyPower",
                        minWidth: 150,
                        slot:"odlApplyPower"
                    },
                    {
                        title: "新车账户",
                        key: "newAccountPower",
                        minWidth: 150,
                        slot:"newAccountPower"
                    },
                    {
                        title: "二手车账户",
                        key: "oldAccountPower",
                        minWidth: 150,
                        slot:"oldAccountPower"
                    },

                    {
                        title: "状态",
                        key: "lockFlag",
                        minWidth: 150,
                        slot:"lockFlag"
                    },
                    {
                        title: "创建时间",
                        key: "createTime",
                        minWidth: 150,
                    },
                    {
                        title: "操作",
                        key: "action",
                        minWidth: 200,
                        align: "center",
                        fixed: "right",
                        slot: "action"
                    }
                ],
                data: [],
                total: 0
            };
        },
        props:{
            channelId:{
                type:String,
            },
            isNewCarRole:{
                type:String,
            },
            isOldCarRole:{
                type:String,
            },
            operationUser:{
                type:String,
            }
        },
        methods: {
            init() {

            },

            changePage(v) {
                this.useInfoForm.pageNumber = v;
                this.getUserInfo();
                this.clearSelectAll();
            },
            changePageSize(v) {
                this.useInfoForm.pageSize = v;
                this.getUserInfo();
            },
            getList() {

            },
            handleSearch() {
                this.useInfoForm.pageNumber = 1;
                this.useInfoForm.pageSize = 10;
                this.getUserInfo();
            },
            handleReset() {
                this.$refs.useInfoForm.resetFields();
                this.useInfoForm.pageNumber = 1;
                this.useInfoForm.pageSize = 10;
                this.useInfoForm.roleCode = [];
                this.useInfoForm.roleName = "";
                // 重新加载数据
                this.getUserInfo();
            },
            changeSort(e) {
                this.useInfoForm.sort = e.key;
                this.useInfoForm.order = e.order;
                if (e.order === "normal") {
                    this.useInfoForm.order = "";
                }
                this.getUserInfo();
            },
            remove(v) {

            },
            showSelect(e) {
                this.selectList = e;
                this.selectCount = e.length;
            },
            clearSelectAll() {
                this.$refs.table.selectAll(false);
            },
            //部门树
            getDeptInfoTree(v){
                getDeptInfoByChannelId(v,"0").then(res => {
                    this.loading = false;
                    if (res.code === "0000") {
                        res.data.forEach(function (e) {
                            if (e.isParent) {
                                e.loading = false;
                                e.children = [];
                            }
                        });
                        this.areasData= res.data;
                        if(res.data[0]){
                            this.useInfoForm.deptId=res.data[0].id;
                            //一级部门id
                            this.deptIdOne=res.data[0].id;
                            this.loading = true;
                            if(this.useInfoForm){
                                getApplyUserInfo(this.useInfoForm).then(res => {
                                    this.loading = false;
                                    if (res.code === "0000") {
                                        this.data = res.data.records;
                                        this.total = res.data.total;
                                    }
                                });
                            }
                        }

                    }
                });

            },

            getUserInfo(){
                this.loading = true;
                getApplyUserInfo(this.useInfoForm).then(res => {
                    this.loading = false;
                    if (res.code === "0000") {
                        this.data = res.data.records;
                        this.total = res.data.total;
                    }
                });
            },
             // 点击新车停进件
            stopNewCar(){
                if(this.selectList.length<=0){
                    this.$Message.warning("您还未选择数据!");
                    return;
                }
                console.log("点击新车停进件")
                console.log(this.selectList)
                let userManage ='0';
                let ids = [];
                this.selectList.forEach(function(e) {
                    console.log("我来循环了"+e.userId)
                    if(e.newApplyPower=='0'){
                    console.log("我是正确的"+e.userId)
                        ids += e.userId + ",";
                    }
                    if(e.userManage=='9'){
                        userManage=9;
                    }
                    // if(e.lockFlag=='9'){
                    // this.$Message.warning("选择数据中已有被!");
                    // return;
                    // }
                });
                if(ids.length<=0){
                    this.$Message.warning("选择数据暂无符合条件数据!");
                    return;
                }
                ids = ids.substring(0, ids.length - 1);
                let obj = {
                    ids: ids,
                    channelId:this.channelId,
                    type:'newCar',
                    userManage:userManage
                };
                stopApply(obj).then(res => {
                    this.loading = false;
                    if (res.code === "0000") {
                         this.$Message.success("操作成功!");
                         this.clearSelectAll();
                         this.getUserInfo();
                    }
                });
                console.log("点击新车停进件")
            },

            // 点击二手车停进件
            stopOldCar(){
                if(this.selectList.length<=0){
                    this.$Message.warning("您还未选择数据!");
                    return;
                }
                let userManage ='0';
                let ids = [];
                console.log(this.selectList)
                this.selectList.forEach(function(e) {
                    if(e.odlApplyPower=='0'){
                        ids += e.userId + ",";
                    }
                    if(e.userManage=='9'){
                        userManage=9;
                    }
                });
                if(ids.length<=0){
                    this.$Message.warning("选择数据暂无符合条件数据!");
                    return;
                }
                ids = ids.substring(0, ids.length - 1);
                let obj = {
                    ids: ids,
                    channelId:this.channelId,
                    type:'oldCar',
                    userManage:userManage
                };
                stopApply(obj).then(res => {
                    this.loading = false;
                    if (res.code === "0000") {
                         this.$Message.success("操作成功!");
                         this.clearSelectAll();
                         this.getUserInfo();
                    }
                });
                console.log("点击二手车停进件")
            },
            // 点击新车 启用进件
            startNewCar(){
                if(this.selectList.length<=0){
                    this.$Message.warning("您还未选择数据!");
                    return;
                }
                let userManage ='0';
                let ids = [];
                this.selectList.forEach(function(e) {
                    if(e.newApplyPower=='9'){
                        ids += e.userId + ",";
                    }
                    if(e.userManage=='9'){
                        userManage=9;
                    }
                });
                if(ids.length<=0){
                    this.$Message.warning("选择数据暂无符合条件数据!");
                    return;
                }
                ids = ids.substring(0, ids.length - 1);
                let obj = {
                    ids: ids,
                    channelId:this.channelId,
                    type:'newCar',
                    userManage:userManage
                };
                startApply(obj).then(res => {
                    this.loading = false;
                    if (res.code === "0000") {
                         this.$Message.success("操作成功!");
                         this.clearSelectAll();
                         this.getUserInfo();
                    }
                });
                console.log("点击新车启进件")
            },
            // 点击二手车 启用进件
            startOldCar(){
                if(this.selectList.length<=0){
                    this.$Message.warning("您还未选择数据!");
                    return;
                }
                let userManage ='0';
                let ids = [];
                this.selectList.forEach(function(e) {
                    if(e.odlApplyPower=='9'){
                        ids += e.userId + ",";
                    }
                    if(e.userManage=='9'){
                        userManage=9;
                    }
                });
                if(ids.length<=0){
                    this.$Message.warning("选择数据暂无符合条件数据!");
                    return;
                }
                ids = ids.substring(0, ids.length - 1);
                let obj = {
                    ids: ids,
                    channelId:this.channelId,
                    type:'oldCar',
                    userManage:userManage
                };
                startApply(obj).then(res => {
                    this.loading = false;
                    if (res.code === "0000") {
                         this.$Message.success("操作成功!");
                         this.clearSelectAll();
                         this.getUserInfo();
                    }
                });
                console.log("点击二手车启进件")
            },

            // 点击 停新车账户
            stopNewAccount(){
                if(this.selectList.length<=0){
                    this.$Message.warning("您还未选择数据!");
                    return;
                }
                let userManage ='0';
                let ids = [];
                this.selectList.forEach(function(e) {
                    if(e.newAccountPower=='0'){
                        ids += e.userId + ",";
                    }
                    if(e.userManage=='9'){
                        userManage=9;
                    }
                });
                console.log("ids"+ids)
                if(ids.length<=0){
                    this.$Message.warning("选择数据暂无符合条件数据!");
                    return;
                }
                ids = ids.substring(0, ids.length - 1);
                let obj = {
                    ids: ids,
                    channelId:this.channelId,
                    type:'newCar',
                    userManage:userManage
                };
                stopUser(obj).then(res => {
                    this.loading = false;
                    if (res.code === "0000") {
                         this.$Message.success("操作成功!");
                         this.clearSelectAll();
                         this.getUserInfo();
                    }
                });
                console.log("点击停新车账户")
            },
            // 点击 启新车账户
            startNewAccount(){
                if(this.selectList.length<=0){
                    this.$Message.warning("您还未选择数据!");
                    return;
                }
                let userManage ='0';
                let ids = [];
                this.selectList.forEach(function(e) {
                    if(e.newAccountPower=='9'){
                        ids += e.userId + ",";
                    }
                    if(e.userManage=='9'){
                        userManage=9;
                    }
                });
                if(ids.length<=0){
                    this.$Message.warning("选择数据暂无符合条件数据!");
                    return;
                }
                ids = ids.substring(0, ids.length - 1);
                let obj = {
                    ids: ids,
                    channelId:this.channelId,
                    type:'newCar',
                    userManage:userManage
                };
                startUser(obj).then(res => {
                    this.loading = false;
                    if (res.code === "0000") {
                         this.$Message.success("操作成功!");
                         this.clearSelectAll();
                         this.getUserInfo();
                    }
                });
                console.log("点击启新车账户")
            },

            // 点击停二手车账户
            stopOldAccount(){
                if(this.selectList.length<=0){
                    this.$Message.warning("您还未选择数据!");
                    return;
                }
                let userManage ='0';
                let ids = [];
                this.selectList.forEach(function(e) {
                    if(e.oldAccountPower=='0'){
                        ids += e.userId + ",";
                    }
                    if(e.userManage=='9'){
                        userManage=9;
                    }
                });
                if(ids.length<=0){
                    this.$Message.warning("选择数据暂无符合条件数据!");
                    return;
                }
                ids = ids.substring(0, ids.length - 1);
                let obj = {
                    ids: ids,
                    channelId:this.channelId,
                    type:'oldCar',
                    userManage:userManage
                };
                stopUser(obj).then(res => {
                    this.loading = false;
                    if (res.code === "0000") {
                         this.$Message.success("操作成功!");
                         this.clearSelectAll();
                         this.getUserInfo();
                    }
                });
                console.log("点击停二手车账户")
            },

            // 点击启二手车账户
            startOldAccount(){
                if(this.selectList.length<=0){
                    this.$Message.warning("您还未选择数据!");
                    return;
                }
                let userManage ='0';
                let ids = [];
                this.selectList.forEach(function(e) {
                    if(e.oldAccountPower=='9'){
                        ids += e.userId + ",";
                    }
                    if(e.userManage=='9'){
                        userManage=9;
                    }
                });
                if(ids.length<=0){
                    this.$Message.warning("选择数据暂无符合条件数据!");
                    return;
                }
                ids = ids.substring(0, ids.length - 1);
                let obj = {
                    ids: ids,
                    channelId:this.channelId,
                    type:'oldCar',
                    userManage:userManage
                };
                startUser(obj).then(res => {
                    this.loading = false;
                    if (res.code === "0000") {
                         this.$Message.success("操作成功!");
                         this.clearSelectAll();
                         this.getUserInfo();
                    }
                });
                console.log("点击启二手车账户")
            },

            loadData(item, callback) {
                getDeptInfoByChannelId(this.channelId,item.id).then(res => {
                    if (res.code === "0000") {
                        res.data.forEach(function (e) {
                            if (e.isParent) {
                                e.loading = false;
                                e.children = [];
                            }
                        });
                        callback(res.data);
                    }
                });
            },

            changeSelect(v) {
                this.selectCount = v.length;
                this.selectList = v;
            },
            selectTree(v) {
                if (v.length > 0) {
                    // 转换null为""
                    for (let attr in v[0]) {
                        if (v[0][attr] === null) {
                            v[0][attr] = "";
                        }
                    }
                    let str = JSON.stringify(v[0]);
                    let data = JSON.parse(str);
                    this.useInfoForm.deptId=data.id;
                    this.getUserInfo();
                }else{
                    this.cancelEdit();
                    this.getUserInfo();
                }
            },
            cancelEdit() {
                this.useInfoForm.deptId=this.deptIdOne;
            },
            // 下拉框展开获取用户角色
            queryRoleSelectList(val) {
                if (val) {
                    this.getBaseInfoPage();
                }
            },
            //获取用户角色
            getBaseInfoPage() {
                this.selectParam.pageSize = this.pageData.pageSize;
                this.selectParam.pageNumber = this.pageData.pageNumber;
                if (this.mainRoleName == "请选择") {
                    this.selectParam.roleName = "";
                } else {
                    this.selectParam.roleName = this.mainRoleName;
                }
                if(this.$parent.isNewCarRole == '1' && this.$parent.isOldCarRole =='1'){
                    //新车二手车权限都有
                    this.selectParam.roleType = "";
                }else if(this.$parent.isNewCarRole == '1' && this.$parent.isOldCarRole =='0'){
                    //新车权限
                    this.selectParam.roleType = "newCar";
                }else if(!this.$parent.isNewCarRole == '0' && this.$parent.isOldCarRole =='1'){
                    this.selectParam.roleType = "oldCar";
                }
                getRoleList(this.selectParam).then(res => {
                    if (res.code == "0000") {
                        this.roleList = res.data.records;
                        this.pageData.total = res.data.total;
                    }
                });
            },
            changeBasePage(value) {
                this.pageData.pageNumber = value;
                this.queryRoleSelectList(this.selectParam);
            },
            // 输入调用的方法
            remoteMethod1(query) {
                console.log(query)
                this.useInfoForm.roleCode=query
                this.getRoleListInfo(query);
            },
            // 选择角色
            selectPord(val) {
                console.log(val);
                if (val) {
                    this.useInfoForm.roleCode = val.roleCode;
                } else {
                    this.mainRoleName = "请选择";
                    this.getRoleListInfo(val);
                }
            },
            getRoleListInfo(v) {
                let param ={
                    pageNumber: 1,
                    pageSize: 5,
                }
                getRoleList(param).then(res => {
                    if (res.code === "0000") {
                        this.roleList = res.data.records;
                    }
                });
            },
            getRole(newCar,oldCar){
                this.newCarRole = newCar;
                this.oldCarRole = oldCar;
            },
            resetPassword(val){
                this.$Modal.confirm({
                    title: "确认重置",
                    content: "您确认重置用户 " + val.userRealName + "  密码",
                    onOk: () => {
                        this.operationLoading = true;
                        resetPassWord(val.userId).then(res => {
                            this.operationLoading = false;
                            if (res.code === "0000") {
                                this.$Message.success("操作成功");
                                this.getUserInfo();
                            }
                        });
                    }
                });
            },

            senderUser(val){
                this.$Modal.confirm({
                    title: "确认同步",
                    content: "您确认同步用户 " + val.userRealName + "信息",
                    onOk: () => {
                        this.operationLoading = true;
                        senderUser({userId:val.userId}).then(res => {
                            this.operationLoading = false;
                            if (res.code === "0000") {
                                this.$Message.success("操作成功");
                            }
                        });
                    }
                });
            },

        },
        mounted() {
        }
    };
</script>

<style scoped>
    .search .tree-bar {
        max-height: 500px;
        overflow: auto;
        margin-top: 5px;
    }

    .search .tree-bar::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .search .tree-bar::-webkit-scrollbar-thumb {
        border-radius: 4px;
        -webkit-box-shadow: inset 0 0 2px #d1d1d1;
        background: #e4e4e4;
    }

    .search .ivu-tree .ivu-tree-empty {
        margin-top: 10px;
        font-size: 12px;
    }

    .search .expand {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .search .icon {
        cursor: pointer;
    }

    :hover {
        color: #1890ff !important;
    }

    .search .operation {
        margin-bottom: 2vh;
    }

    .search .select-count {
        font-size: 13px;
        font-weight: 600;
        color: #40a9ff;
    }

    .search .select-title {
        font-size: 12px;
        font-weight: 600;
        color: #40a9ff;
    }

    .search .select-clear {
        margin-left: 10px;
    }

    .search .page {
        margin-top: 2vh;
    }

    .search .drop-down {
        font-size: 13px;
        margin-left: 5px;
    }

</style>
